package com.pj.wisdomlogistics.mvp.presenter;


import com.pj.wisdomlogistics.mvp.contract.RepairFinishContract;
import com.pj.wisdomlogistics.mvp.frame.ActivityPresenter;
import com.pj.wisdomlogistics.mvp.model.RepairFinishModel;
import com.pj.wisdomlogistics.rx.FilterSubscriber;

import java.io.File;
import java.util.List;


public class RepairFinshPresenter extends ActivityPresenter<RepairFinishModel, RepairFinishContract.View> implements RepairFinishContract.Presenter {
    public static final String TAG = "RepairFinshPresenter";


    @Override
    public void carFinish(String fixWorkerRemark, int repairApplyID, List<File> mFiles) {
        addSubscription(getModel().finishRepairApply(fixWorkerRemark, repairApplyID, mFiles), new FilterSubscriber() {
            @Override
            public void onError(int errorCode, String errorMsg) {
                getView().onError(errorMsg);
            }

            @Override
            public void onNext(Object mO) {
                getView().onSuccess();
            }
        });
    }
}
